package hu.bme.j2ee.v37zen.web.beans;

import hu.bme.j2ee.v37zen.beans.ExporterBean;
import java.security.Principal;
import javax.annotation.security.RolesAllowed;
import javax.ejb.EJB;
import javax.faces.bean.ManagedBean;
import javax.faces.bean.RequestScoped;
import javax.faces.context.FacesContext;

/**
 *
 * @author Kiss Dániel
 */
@ManagedBean
@RequestScoped
@RolesAllowed({"USER","ADMIN"})
public class ExporterManageBean {
    
    @EJB 
    ExporterBean eb;
    
    public String getDials(){
        Principal principal = FacesContext.getCurrentInstance().getExternalContext().getUserPrincipal();
        if (principal != null) {
            return eb.localExport(principal.getName());
        }
        return "";
    }
}
